	<div class="span9">
		<div class="row">
			<div class="span9">
				<div class="box recipe_filter">
					<strong>Snabbsök</strong> <input type="text" id="autosuggest" placeholder="Sökord"/>
				</div>
			</div>
		</div>
		<div class="pagerrow">
			<?php for($i=1;$i<=$pages;$i++){
		    	print "<a class='pagerbtn' href='/recept/page$i'>$i</a>";
		    }?>
		</div>
		<?php 
		$maxslen = 120;
		foreach($recipes as $rec){
			
			$sstr = $rec->tillagning;
			if(strlen($sstr)>$maxslen)
				$sstr = substr($sstr, 0, strpos($sstr, ' ', $maxslen))."...";

			?>
	        <div class="row">
	        	<div class="span9 recipe_wrapper">
	        		<div class="row">
			            <div class="span2">
			            	<div class="recipe_imgbox">
			            		<img src="/images/plate.jpg"/>
			            	</div>
			            </div>
			            <div class="span7">
			            	<div class="recipe_box">
			            		<h4><?php echo $rec->namn; ?></h4>
			            		<p class="recipe_row_col">
			            			<?php echo $sstr; ?>
			            		</p>
			            		<a class="blue_btn recipe_btn" href="/recept/<?php echo $rec->slug;?>">Läs mer &raquo;</a>		            		
			            	</div>
			            </div>
			        </div>
		         </div>
	        </div>
	    <?php }	?>
	    <?php for($i=1;$i<=$pages;$i++){
	    	print "<a class='pagerbtn' href='/recept/page$i'>$i</a>";
	    }?>
</div>
<script language="javascript" type="text/javascript">
$(function(){

	$.ajax({
		url:"/ajax/get_recipes",
		dataType : "json",
		error : function(err){
			console.dir(err);
		},
		success : function(data){
			$("#autosuggest").autocomplete({
				minLength : 3,
				source :data,
				select : function(event, ui){
					window.location.href = "/recept/"+ui.item.value;
				}
			});
		}
	});
});
</script>